package com.jzo2o.customer.controller.agency;


import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController("agencyBankAccountController")
@RequestMapping("/agency/bank-account")
@RequiredArgsConstructor
public class AgencyBankAccountController {
    private final IBankAccountService bankAccountService;

    @PostMapping
    @ApiOperation("新增或更新银行账户")
    public void saveOrUpdate(@RequestBody BankAccountUpsertReqDTO reqDTO) {

        bankAccountService.saveOrUpdateBankAccount(reqDTO);
    }

    @GetMapping("/currentUserBankAccount")
    @ApiOperation("查询当前用户银行账户")
    public BankAccountResDTO queryCurrentUserBankAccount() {
        BankAccountResDTO resDTO =bankAccountService.queryCurrentUserBankAccount();
        return resDTO;
    }
}
